import * as React from 'react';
// import Test from './pages/test';
import {Button, Icon, Provider} from '@ant-design/react-native';
import {Text, View} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import User from './pages/me/User';
import LoginRouter from './pages/me/LoginRouter';
import BlogRoute from './pages/blog/BlogRoute';
import MessageRoute from './pages/message/MessageRoute';
import ChatRouter from './pages/chat/chatRouter';
const Tab = createBottomTabNavigator();

export default function App() {
  return (
    <Provider>
      <NavigationContainer>
        <Tab.Navigator
          screenOptions={({route}) => {
            return {
              tabBarIcon: ({focused}) => {
                let iconName = 'alert';
                if (route.name === '博客') {
                  iconName = focused ? 'file-protect' : 'ios-list-box';
                } else if (route.name === 'Settings') {
                  iconName = focused ? 'ios-list-box' : 'ios-list';
                }
                // You can return any component that you like here!
                return <Icon name="align-center" size="md" color="red" />;
              },
              tabBarActiveTintColor: 'tomato',
              tabBarInactiveTintColor: 'gray',
              headerShown: false, //不展示header
            };
          }}>
          <Tab.Screen name="博客" component={BlogRoute} />
          <Tab.Screen name="留言1" component={MessageRoute} />
          <Tab.Screen name="聊天" component={ChatRouter} />
          <Tab.Screen name="资源" component={LoginRouter} />
          <Tab.Screen name="我的" component={LoginRouter} />
          {/*
        <Tab.Screen
          name="Settings"
          options={{
            headerRight: () => <Button>sds</Button>,
          }}
          component={Test}
        /> */}
        </Tab.Navigator>
      </NavigationContainer>
    </Provider>
  );
}
